-
Notifications
You must be signed in to change notification settings - Fork 3
feat: convert single-value enums to const for base types #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: convert single-value enums to const for base types #126
Conversation
Greptile OverviewGreptile SummaryThis PR converts single-value enums to However, the PR also flattens
Key changes:
Issue found:
Confidence Score: 1/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/external_accounts/LightningExternalAccountInfo.yaml | Flattened schema but broke validation - now allows invalid states with zero or multiple payment methods |
| openapi/components/schemas/common/BaseWalletInfo.yaml | Converted single-value enum to const for accountType |
| openapi/components/schemas/errors/Error412.yaml | Converted single-value enums to const for both status and code fields |
| openapi.yaml | Bundled file with enum-to-const conversions and broken LightningExternalAccountInfo validation |
| mintlify/openapi.yaml | Copy of bundled file with same changes as openapi.yaml |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant Schema as OpenAPI Schema Files
participant Build as Build System
participant Validator as Schema Validator
Dev->>Schema: Convert single-value enums to const
Note over Schema: accountType: enum[LIGHTNING]<br/>→ accountType: const LIGHTNING
Dev->>Schema: Flatten LightningExternalAccountInfo
Note over Schema: Remove allOf + oneOf structure<br/>Make invoice/bolt12/lightningAddress optional
Schema-->>Validator: Validate new schema
Note over Validator: ⚠️ BREAKING CHANGE<br/>Previously: exactly one payment method required<br/>Now: zero or multiple allowed
Dev->>Build: Run npm run build:openapi
Build->>Schema: Bundle modular YAML files
Build->>Build: Generate openapi.yaml
Build->>Build: Copy to mintlify/openapi.yaml
Build-->>Dev: Updated bundled files
Note over Dev,Validator: Issue: Lightning accounts can now be<br/>created without any payment method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment

Convert single-value enums to const for base types
This PR replaces single-value enums with
constproperties throughout the OpenAPI schema. This change improves schema clarity and validation behavior.Additionally, the PR flattens the
LightningExternalAccountInfoschema structure, converting it from a complex nested structure withallOfandoneOfcombinations to a simpler flat object with optional properties.